<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>帮助提示列表</title>
	 <script type="text/javascript" src="/script/mootools.js"></script>
    <script type="text/javascript" src="/script/mootools-more.js"></script>
    <link rel="stylesheet" type="text/css" href="/script/jspxnet-ui.css"/>
    <script type="text/javascript" src="/script/jspxnet.js"></script>
    <script type="text/javascript" src="/script/jspxnet-ui-roc.js"></script>
    <link rel="stylesheet" type="text/css" href="/script/jspxnet-ui.css"/>
    <link href="/share/mskin/default/devcenter.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript">
        window.addEvent('domready', function() {
            var columnModels = [{"name":"id","caption":"选择","type":"string","edit":"true","input":"selectbox","width":30},
			{"name":"id","caption":" ID","input":"text","type":"String","width":60,"edit":false},
			{"name":"docType","caption":"文档类型","input":"select","type":"number","width":120,"option":[{"value":0,"name":"HTML","ordinal":0},{"value":1,"name":"MARKDOWN","ordinal":1},{"value":2,"name":"LINK","ordinal":2},{"value":3,"name":"BASE64","ordinal":3}],"edit":false},{"name":"title","caption":"标题","input":"text","type":"String","width":300,"edit":false}];
            var buttons = [];
            buttons.push(new Element('button', {'type':'button','class':'jTDSelectAll','html':'全选',
                'events':
                    {
                        'click': function(event)
                        {
                            jtable.selectAll();
                            return false; //google 浏览器要
                        }
                    }
            }));
            buttons.push(new Element('button', {'type':'button','class':'jTDInverse','html':'返选',
                'events':
                    {
                        'click': function(event)
                        {
                            jtable.selectedConvert();
                            return false; //google 浏览器要
                        }
                    }
            }));
            buttons.push(new Element('div', {'class':'btnseparator'}));
            buttons.push(new Element('button', {'type':'button','class':'jDTAdd','html':'添加',
                'events':
                    {
                        'click': function(event)
                        {
                            window.location = "/devcenter/aehelptip.html";
                            return false;
                        }
                    }
            }));
            //本页面为放入回收站
            buttons.push(new Element('button', {'type':'button','class':'jDTDelete','html':'删除',
                'events':
                    {
                        'click': function(event)
                        {
                            var selects = jtable.getSelecteds('id');
                            //提示操作 begin
                            if(selects.length < 1) {
                                var dialog = new JDialog.Alert({
                                    'message': '选择你要操作的行.'
                                });
                                dialog.show();
                                return false;
                            }
                            //提示操作 end
                            if(!confirm('你确定要删除吗?')) return;
                            var posts = {
                                ids:selects
                            };
                            new Request.ROC({'url':'/devcenter/help/delete.jwc','data':posts,
                                onSuccess:function(obj)
                                {
                                    if (obj.success) jtable.refresh();
                                    else {
                                        var dlg = new JDialog.Alert({
                                            title: '消息提示',
                                            message:obj.message
                                        });
                                        dlg.show();
                                    }
                                }
                            }).send();
                            return false;
                        }
                    }
            }));
            buttons.push(new Element('div', {'class':'btnseparator'}));
            var fen = new Element('label', {'html':'&nbsp;|&nbsp;','styles':{'float':'left','color':'#ffffff'}});
            buttons.push(fen);
            var findBox = new Element('input', {'type':'text','name':'find','id':'find'});
            var labelFind = new Element('label', {'html':'关键字','styles':{'float':'left'}});
            labelFind.adopt(findBox);
            buttons.push(labelFind);
            buttons.push(new Element('button', {'type':'button','class':'jTDRefresh','html':'搜索',
                'events':
                    {
                        'click': function(event)
                        {
                            jtable.loadData('/devcenter/help/list/page.jwc');
                            return false;
                        }
                    }
            }));
            jtable = new JDataTable({table:"grid",title:'帮助提示列表',url:'/devcenter/help/list/page.jwc',
                accordion:true,
                autoSectionToggle:false,
                showTog:true, //显示详细
                editMode:false,
                columnModels:columnModels,
                buttons:buttons,
                pagination:true,
                serverSort:true,
                showCaption: true,
                sortCaption: true,
                alternaterows: true,
                resizeColumns: true,
                multiselect:true,
                ondblclick:function (selects) {
                    var id = selects.rowdata.id;
                    window.location = "/devcenter/aehelptip.html?id="+id;
                }
            });
        });
    </script>
</head>
<body jskin="true">
<div class="mWrap">
    <div class="mTitPanel jboardLogo">帮助管理</div>
    <div class="mConPanel">
        <div id="helpTip"></div>
        <div id="grid"></div>
    </div>
</div>
</body>
</html>
